package pers.dawnyang.common.enums;

/**
 * 返回枚举值
 * 
 * @author dawn
 *
 */
public enum ResultEnum {
    SUCCESS(true, 200, "操作成功"), 
    UNKNOWN_ERROR(false, 500, "系统错误！"),
    ERROR(false, 503, "操作失败！"), 
    ERROR_MENUTYPE(false, 503, "父级菜单不能为按钮！"), 
    DATA_IS_NULL(true, 503, "数据为空"), 
    NOT_PARENT_NODE(false, 503, "不能添加到叶子节点！"),
    WRONG_PHONE(false, 503, "手机号错误"), 
    UNAUTH(false, 403, "功能未授权! 请联系管理员。"), 
    LOGIN_TIMEOUT(false, 408, "登录超时！请重新登录。"), 
    VALIDE_ERROR(false, 500, ""),
    NOT_LEAF_NODE(false, 503, "请选择叶子节点！"), 
    ERROR_VALIDCODE(false, 503, "验证码错误"), 
    ERROR_USERPWD(false, 503, "用户名或密码错误"),
    ERROR_EXCEEDROLE(false, 503, "无权操作！请选择小于自己权限等级的角色。"), 
    ERROR_EXCEEDROLE_USER(false, 503, "无权操作！请选择小于自己角色等级的用户。"),
    ERROR_EXCEEDROLE_ROLE(false, 503, "无权操作！请选择小于自己权限等级的角色。"), 
    ERROR_SESSION_EXPIRES(false, 408, "会话过期，请重新登录！"),
    ERROR_SMS_SEND(false, 500, "短信发送失败！"), 
    SUCCESS_SMS_SEND(true, 200, "短信发送成功"), 
    WRONG_SQL(false, 500, "sql结构错误！"),
    WRONG_OLDPWD(false, 503, "原密码错误！"),
    WRONG_NEWPWD_MISMATCH(false, 503, "两次密码不一致！"), 
    ERROR_EXCEL_DOWNLOAD(false, 500, "excel下载失败！"),
    WRONG_DEL_CHILD_FIRST(false, 503, "请先删除叶子节点！"), 
    WRONG_REPEAT_DEPT(false, 503, "已分配该部门！");

    private boolean success;
    private Integer code;
    private String msg;

    ResultEnum(boolean success, Integer code, String msg) {
        this.success = success;
        this.code = code;
        this.msg = msg;
    }

    public Boolean getSuccess() {
        return success;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}